package org.feifei.org.service.impl;

import org.feifei.basic.query.BaseQuery;
import org.feifei.basic.service.impl.BaseServiceImpl;
import org.feifei.basic.util.PageList;
import org.feifei.org.domain.SystemDictionaryDetail;
import org.feifei.org.mapper.SystemDictionaryDetailMapper;
import org.feifei.org.service.SystemDictionaryDetailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author forever
 * @Description: 数据字典明细的Service 实现类
 * @date 2021/12/04 09:34
 */
@Service
public class SystemDictionaryDetailServiceImpl extends BaseServiceImpl<SystemDictionaryDetail> implements SystemDictionaryDetailService {

    @Resource
    private SystemDictionaryDetailMapper systemDictionaryDetailMapper;

    @Override
    public void save(SystemDictionaryDetail systemDictionaryDetail) {
        if (systemDictionaryDetail.getId() != null) {
            systemDictionaryDetailMapper.update(systemDictionaryDetail);
        } else {
            systemDictionaryDetailMapper.save(systemDictionaryDetail);
        }
    }

    @Override
    public List<SystemDictionaryDetail> getByTypeId(Long id) {
        return systemDictionaryDetailMapper.getByTypeId(id);
    }
}
